<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>扩展运算符</title>
</head>
<body>
<div></div>
<div></div>
<div></div>
<script>
  //【...】扩展运算符,将数组转船为逗号分隔
  const arr_1 = ['aa','bb','ccc'];

  //声明一个函数
  function chunwan(){
    console.log(arguments);
  }
  chunwan(...arr_1);

  //应用
  //1.数组合并
  const arr = ['aa','bb','cc'];
  const arr2 = ['dd','ee'];
  // const arr3 = arr.concat(arr2);
  const arr3 = [...arr,...arr2];
  console.log(arr3);

  //2.数组的克隆
  const array = ['e','g','m'];
  const array1 = [...array];
  console.log(array1);

  //3.将伪数组转换称真正的数组
  const divs = document.querySelectorAll('div');
  const divArr = [...divs];
  console.log(divArr);



</script>
</body>
</html>